package main

import "fmt"

type Person struct {
	Name string
	Age  int
}

func (p *Person) GetName() string {
	return p.Name
}

type Student struct {
	Person
	score int
	Age   int
}

func (s *Student) GetScore() int {
	fmt.Println("getScore:", s.score)
	return s.score
}

func (s *Student) SetScore(score int) {
	fmt.Println("setScore:", score)
	s.score = score
}

type Node struct {
	data int
	next *Node
}

func ShowNode(node *Node) {
	for node != nil {
		fmt.Println(*node)
		node = node.next
	}
}

func main() {
	var stu = new(Student)
	stu.Person.Name = "xiaobai"
	stu.Age = 6
	stu.score = 100
	fmt.Println(stu)
	fmt.Println(stu.Person.Name, stu.Name)
	fmt.Println(stu.GetScore(), stu.GetName())
	fmt.Println("age:", stu.Person.Age)

	var node = new(Node)
	ShowNode(node)
}
